package com.zll.controller;

import com.zll.Store;
import com.zll.service.StoreService;
import com.zll.utils.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/store")
public class StoreController {

    @Autowired
    private StoreService storeService;

    @PostMapping("/add")
    public JsonResult add(@RequestBody Store store) {
        try {
            storeService.add(store);
            return new JsonResult();
        } catch (Exception e) {
            return new JsonResult(false,"操作失败了哦，请稍后重试！");
        }

    }
}
